<{include file="public/header" /}>
<body>

<div style="padding: 10px; background-color: #F2F2F2;padding-bottom: 150px">
  <form class="layui-form layui-form-pane" >
  	
  	<{volist name="exams" id="vo" empty="$empty"}>
		<div class="layui-card">
  		  <div class="layui-card-body">			
					<!-- <div class="layui-input-block"> -->
						
				      <input type="radio" name="eid" value="<{$vo.eid}>" title="<{$vo.title}>">
				    <!-- </div> -->
			</div>
	  	 </div>				
	<{/volist}>
			    
			  
	
  		
    <div class="layui-card" style="padding-top: 15px;">
      <!-- <div class="layui-card-header">卡片面板</div> -->
      <div class="layui-card-body">

        <div class="layui-form-item">
            <input type="hidden" name="qids"  value="<{$qids}>">
        </div>
        <div class="layui-form-item">
            <button class="layui-btn layui-btn-fluid" lay-submit="" type = "button" lay-filter="demo2" id="demo2">提交</button>
        </div>
      </div>
    </div>
  </form>
</div>



<script>

layui.use(['form','element','layer','jquery'], function(){
  var $ = layui.$
  ,form = layui.form,element = layui.element,layer = layui.layer;
  //----------上面引入layui下面开始业务，分割一下-----------------//
   //监听表单提交
  form.on('submit(demo2)', function(data){
    // layer.alert(JSON.stringify(data.field), {
    //   title: '最终的提交信息'
    // })
        layer.confirm('确定提交?', {btn: ['提交','取消'],icon: 3, title:'提示'}
        ,function(index){
          //do something
            $.post("<{:url('do_add_q_to_exam')}>",data.field,function(data,status){
              //alert(data);
              //alert(JSON.stringify(data));
              //console.log(data);
              if(data===1){
                layer.msg('提交成功!',{icon: 6,time:1000},function(index){
                   x_father_close();
                   //parent.location.reload();
                });
                
              }else{
                layer.alert(data,function(index){
                  layer.close(index);
                }); 
              }
           })
          
        }
      );
     
    
  });
  
});
//删除 预览图片需要加载jquery    
// function deleteImg(obj){
//             obj.parent('.imglist').remove();
//             //var aa=$('div');
//             //aa.remove('#imglist');
// }

</script>


</body>
</html>